<template>
  <div class="scheme-model-box">
    <!-- 地图-模型参数配置 -->
    <div class="map-container">
      <Map @onload="handleMapLoad" />
    </div>
    <div class="content-box">
      <div class="search-box">
        <SchemeSelect
          :placeholder="state.placeholderOne"
          :define-options="state.options"
          :images="'u97.png'"
        />
      </div>
      <div class="legend-box">
        <span class="legend-title">图例</span>
        <div class="legend-item">
          <el-row>
            <el-col :span="12">
              <el-checkbox v-model="checkSec" label="预报对象" />
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-checkbox v-model="checkTopology" label="拓扑结构" />
            </el-col>
            <el-col :span="12">
              <el-checkbox v-model="checkRiver" label="河道" />
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-checkbox v-model="checkJsUnit" label="计算单元" />
            </el-col>
            <el-col :span="12">
              <el-checkbox v-model="checkWata" label="小流域" />
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-checkbox v-model="checkNode" label="节点" />
            </el-col>
            <el-col :span="12">
              <el-checkbox v-model="checkRainSite" label="雨量站" />
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="scheme-box" @click="handelOpenDetail" v-show="!showSchemeDetail">
        <img src="@/assets/images/compute/u19.png" />
        <span>大汶河混合模式20201010</span>
        <img src="@/assets/images/compute/u18.png" />
      </div>
      <PublishModel />
      <ViewPublishModel />
    </div>
  </div>
</template>
<script setup>
import Map from '@/components/app-map/map.vue'
import SchemeSelect from '@/components/app-publicui/scheme-select.vue'
import PublishModel from './cpns/PublishModel/Index.vue'
import ViewPublishModel from './cpns/ViewPublishModel/index.vue'
import { ref, reactive } from 'vue'
const showSchemeDetail = ref(false)
const state = reactive({
  placeholder: '大汶河优选方案',
  placeholderOne: '大汶河流域',
  options: [
    {
      value: '1',
      label: '大汶河流域'
    }
  ]
})
function handelOpenDetail() {
  showSchemeDetail.value = true
}
//关闭详情页
function closePage(value) {
  showSchemeDetail.value = value
}
const emit = defineEmits(['savePublish'])
//保存
function savePublish() {
  emit('savePublish')
}
</script>
<style lang="less" scoped>
.scheme-model-box {
  position: relative;
  width: 100%;
  height: 100%;
  .map-container {
    background-color: #f5f5f5;
  }
  .content-box {
    .search-box {
      position: absolute;
      left: 30px;
      top: 50px;
    }
    .legend-box {
      position: absolute;
      bottom: 20px;
      width: 220px;
      height: 170px;
      margin-left: 20px;
      border: #169bd5 2px solid;
      border-radius: 5px;
      background: rgba(255, 255, 255, 0.7);
      .legend-title {
        display: block;
        margin-left: 30px;
        margin-top: 10px;
        color: #169bd5;
        font-weight: 500;
      }
      .legend-item {
        margin-left: 20px;
        margin-top: 10px;
      }
    }
    .scheme-box {
      display: flex;
      justify-content: space-around;
      align-items: center;
      position: absolute;
      right: 30px;
      top: 50px;
      width: 300px;
      height: 40px;
      border: 1px solid #169bd5;
      background: white;
      img:nth-of-type(1) {
        width: 25px;
        height: 25px;
        transform: rotate(90deg);
      }
      span {
        color: #169bd5;
      }
      img:nth-of-type(2) {
        width: 30px;
        height: 30px;
      }
    }
  }
}
</style>
